package com.itheima.string;
//toCharArray方法使字符串转换为字符数组
import java.util.Scanner;

public class Test03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串");
        String s = sc.nextLine();//遍历字符串,获取其中每一个字符;
        char[]chars= s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }
        System.out.println(chars.length);
    }
}
